// src/main/controller/LoginController.js
import Router from "koa-router";
import koaBodyparser from "koa-bodyparser";
import UserService from "@main/service/UserService";
import { LoginError } from "@main/common/CommonError";

let loginRouter = new Router({
  prefix: "/api",
});

loginRouter.post("/login", koaBodyparser(), async (ctx) => {
  ctx.body = ctx.renderJson(await UserService.login(ctx.request.body),'登录成功');
});

export default loginRouter;
